import { Repository } from "typeorm";

import { Injectable } from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";

import { Journal, JournalGateway } from "qqlx-core";
import { JournalSchema } from "qqlx-cdk";

import { PgDaoBigId } from "../../lib/dao.pg.id-big";

@Injectable()
export class JournalDao extends PgDaoBigId<Journal> {
  constructor(
    @InjectRepository(JournalSchema)
    readonly repo: Repository<Journal>,
  ) {
    super({
      repository: repo,
      relations_name: JournalGateway.relations,
    });
  }
}
